package com.stlm2.dems.recharge.entity.base;

import com.stlm2.dems.entity.OrderState;
import com.stlm2.dems.entity.PayChannel;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Author: fuchunyu
 * Date: 2017/6/20
 * Description：
 */
public class BaseRecharge {
    private Integer id;
    private String code;
    private OrderState orderState;
    private BigDecimal money;
    private PayChannel payChannel;
    private Date createTime;
    private Date payTime;
    private Integer userId;
    private String transactionNo;
    private Date cancleTime;
    private Integer flux;
    private Integer fluxId;
    private String phone;

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getFlux() {
        return flux;
    }

    public void setFlux(Integer flux) {
        this.flux = flux;
    }

    public Integer getFluxId() {
        return fluxId;
    }

    public void setFluxId(Integer fluxId) {
        this.fluxId = fluxId;
    }

    public Date getCancleTime() {
        return cancleTime;
    }

    public void setCancleTime(Date cancleTime) {
        this.cancleTime = cancleTime;
    }

    public String getTransactionNo() {
        return transactionNo;
    }

    public void setTransactionNo(String transactionNo) {
        this.transactionNo = transactionNo;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public OrderState getOrderState() {
        return orderState;
    }

    public void setOrderState(OrderState orderState) {
        this.orderState = orderState;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public PayChannel getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(PayChannel payChannel) {
        this.payChannel = payChannel;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    /**
     * 支付渠道
     * @return
     */
    public Integer getPayChannelValue(){
        return (payChannel != null) ? payChannel.getIntValue() : null;
    }

    public void setPayChannelValue(Integer v){
        if(v != null)
            payChannel = PayChannel.getByIntValue(v);
    }

    /**
     * 订单状态
     * @return
     */
    public Integer getOrderStateValue(){
        return (orderState != null) ? orderState.getIntValue() : null;
    }

    public void setOrderStateValue(Integer v){
        if(v != null)
            orderState = OrderState.getByIntValue(v);
    }
}
